/* 
 * File:   EnvCell.h
 * Author: flai0014
 *
 * Created on March 30, 2012, 11:51 AM
 */

#ifndef _ENVCELL_H
#define	_ENVCELL_H
#include "Particle.h"
#include <vector>
#include <iostream>

using namespace std;

class EnvCell {
public:
    EnvCell();
    EnvCell(const EnvCell& orig);
    
    /* This returns the status of the lock on the current cell */
    bool checkLock();
    
    /* This sets the lock on a cell so that no other thread will access it*/
    void getLock();
    
    /* This releases the lock on the cell */
    void releaseLock();
    
    /* This  adds a particle to a cell */
    bool addParticle(Particle * item);
    
    /* This returns a count of the particles ID numbers for error checking*/
    int countParticles();
    
    /* This returns the number of particles currently stored in this cell */
    int numberOfParticles();
    
    /* This returns true if an agent is currently at or waiting for this cell*/
    bool hasAgent();
    
    /* This is a check in function for when an agent is waiting at this cell*/
    void agentCheckIn();
    
    /* this is a check out function for when a agent is leaving the cell */
    void agentCheckOut();
    
    /* This returns a particle that has been removed from the cell */
    Particle * removeParticle();
    
    virtual ~EnvCell();
private:
    vector<Particle *> container;
    bool cellLock;
    int agentCount;

};

#endif	/* ENVCELL_H */

